#%%
import ReUseDetection

#%%
bin_paths = [
    "dataset/zlib_1.2.5/build/libz.so.1.2.5",
    "dataset/zlib_1.2.6/build/libz.so.1.2.6",
    "dataset/zlib_1.2.7/build/libz.so.1.2.7",
    "dataset/zlib_1.2.8/build/libz.so.1.2.8"
]
my_cfgs = [ReUseDetection.MyCFG(p) for p in bin_paths]

#%%
norm_scores = []
dismatch_ratios = []

for i in range(0, len(my_cfgs)):
    for j in range(i + 1, len(my_cfgs)):
        _norm_scores = ReUseDetection.compareCFG(my_cfgs[i], my_cfgs[j], NUM_THREADS=2)
        norm_scores.append(_norm_scores)
        _ratio, _match = ReUseDetection.my_print(_norm_scores, my_cfgs[i], my_cfgs[j])
        dismatch_ratios.append(_ratio)


# %%

dismatch_ratios

#%%

my_cfg1 = my_cfgs[0]

my_cfg2 = my_cfgs[1]

# %%

func_name = "deflateReset"
my_func_node = my_cfg1.get_by_name(func_name)
my_func_node2 = my_cfg2.get_by_name(func_name)

ReUseDetection.compare(my_func_node, [my_func_node2])

# %%
